﻿<UserControl x:Class="GuidGeneratorWPF.GuidGeneratorControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:GuidGeneratorWPF"
             mc:Ignorable="d" Height="Auto" Width="456">
    <UserControl.Resources>
        <Style TargetType="TextBlock">
            <Setter Property="TextWrapping" Value="Wrap" />
        </Style>
        <Style TargetType="RadioButton">
            <Setter Property="Margin" Value="4" />
        </Style>
        <Style TargetType="Button">
            <Setter Property="Margin" Value="4" />
        </Style>
        <Style TargetType="CheckBox">
            <Setter Property="Margin" Value="4" />
        </Style>
        <Style TargetType="TextBox">
            <Setter Property="Margin" Value="4" />
        </Style>
        <local:GuidFormatToBooleanConverter x:Key="guidFormatToBooleanConverter" />
    </UserControl.Resources>
    <Border Name="Border" Background="{StaticResource {x:Static SystemColors.ControlBrushKey}}" BorderThickness="2" BorderBrush="{StaticResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" CornerRadius="4">
        <DockPanel LastChildFill="True">
            <StackPanel Name="TitleBar" Orientation="Horizontal" Background="{StaticResource {x:Static SystemColors.ActiveCaptionBrushKey}}" DockPanel.Dock="Top">
                <Image Stretch="None" Source="/Resources/Guid16.png" Margin="4" />
                <TextBlock Text="GUID Generator" VerticalAlignment="Center" FontWeight="Bold" Foreground="{StaticResource {x:Static SystemColors.ActiveCaptionTextBrushKey}}" />
            </StackPanel>
            <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" DockPanel.Dock="Top">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="0" Text="GUID Format:" Margin="4" FontWeight="Bold" />
                    <RadioButton Grid.Row="1" IsChecked="{Binding Path=GuidFormat, Mode=TwoWay, Converter={StaticResource guidFormatToBooleanConverter}, ConverterParameter=None}" Click="OnRadioButtonGuidFormat_Click" Tag="None">
                        <TextBlock>
                    <Bold>N:</Bold> 32 digits:<LineBreak />
                    <LineBreak />00000000000000000000000000000000
                        </TextBlock>
                    </RadioButton>
                    <RadioButton Grid.Row="2" IsChecked="{Binding Path=GuidFormat, Mode=TwoWay, Converter={StaticResource guidFormatToBooleanConverter}, ConverterParameter=Dashes}" Click="OnRadioButtonGuidFormat_Click" Tag="Dashes">
                        <TextBlock>
                    <Bold>D:</Bold> 32 digits separated by hyphens:<LineBreak />
                    <LineBreak />00000000-0000-0000-0000-000000000000
                        </TextBlock>
                    </RadioButton>
                    <RadioButton Grid.Row="3" IsChecked="{Binding Path=GuidFormat, Mode=TwoWay, Converter={StaticResource guidFormatToBooleanConverter}, ConverterParameter=CurlyBraces}" Click="OnRadioButtonGuidFormat_Click" Tag="CurlyBraces">
                        <TextBlock>
                    <Bold>B:</Bold> 32 digits separated by hyphens, enclosed in braces:<LineBreak />
                    <LineBreak />{00000000-0000-0000-0000-000000000000}
                        </TextBlock>
                    </RadioButton>
                    <RadioButton Grid.Row="4" IsChecked="{Binding Path=GuidFormat, Mode=TwoWay, Converter={StaticResource guidFormatToBooleanConverter}, ConverterParameter=Parentheses}" Click="OnRadioButtonGuidFormat_Click" Tag="Parentheses">
                        <TextBlock>
                    <Bold>P:</Bold> 32 digits separated by hyphens, enclosed in parentheses:<LineBreak />
                    <LineBreak />(00000000-0000-0000-0000-000000000000)
                        </TextBlock>
                    </RadioButton>
                    <RadioButton Grid.Row="5" IsChecked="{Binding Path=GuidFormat, Mode=TwoWay, Converter={StaticResource guidFormatToBooleanConverter}, ConverterParameter=Hexadecimal}" Click="OnRadioButtonGuidFormat_Click" Tag="Hexadecimal">
                        <TextBlock>
                    <Bold>X:</Bold> Four hexadecimal values enclosed in braces, where the fourth value
                    <LineBreak />is a subset of eight hexadecimal values that is also enclosed in braces:<LineBreak />
                    <LineBreak />{0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
                        </TextBlock>
                    </RadioButton>
                    <StackPanel Grid.Row="6" Orientation="Horizontal">
                        <CheckBox IsChecked="{Binding UpperCase}" Content="_Upper-case" Checked="OnCheckBoxUpperCase_Checked" Unchecked="OnCheckBoxUpperCase_Unchecked" />
                        <CheckBox IsChecked="{Binding StartWithWindows}" Content="_Start with Windows" Name="checkBoxStartWithWindows" />
                    </StackPanel>
                    <StackPanel Grid.Row="7" Orientation="Horizontal" HorizontalAlignment="Left">
                        <Button Click="OnButtonGenerateGuid_Click">Generate _GUID</Button>
                        <Button Click="OnButtonGenerateMultipleGuids_Click" >Generate _Multiple GUIDs...</Button>
                        <Button Click="OnButtonCopy_Click" Name="buttonCopy" IsEnabled="False" >Copy to clipboard</Button>
                    </StackPanel>
                </Grid>
            </ScrollViewer>
            <TextBox Name="textBoxCurrent" IsReadOnly="True" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
                <TextBox.Text>{0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}</TextBox.Text>
            </TextBox>
        </DockPanel>
    </Border>
</UserControl>
